package form;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

import trangchu.UtilDelegate;

public class DSJ_DieuKhoanThanhToan extends UtilDelegate {
	public String MaDK;
	public String TenDK;
	public String getMaDK() {
		return MaDK;
	}
	public void setMaDK(String maDK) {
		MaDK = maDK;
	}
	public String getTenDK() {
		return TenDK;
	}
	public void setTenDK(String tenDK) {
		TenDK = tenDK;
	}
	public Vector<DSJ_DieuKhoanThanhToan> getDieuKhoan(){
		Vector<DSJ_DieuKhoanThanhToan> getDieuKhoan = new Vector<DSJ_DieuKhoanThanhToan>();
		Connection con =UtilDelegate.getConnection();		
		PreparedStatement st;
		try {
			st = con.prepareStatement("select * from DieuKhoanThanhToan");
			ResultSet rs = st.executeQuery();
			while(rs.next()){
				
				String maDK= rs.getString("MaDK");
				String tenDK = rs.getString("TenDK");
				
				DSJ_DieuKhoanThanhToan b = new DSJ_DieuKhoanThanhToan();
				b.setMaDK(maDK);
				b.setTenDK(tenDK);
				
				getDieuKhoan.add(b);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return getDieuKhoan;
	}
}
